def basename filename; filename[0..-5];end
def p_file base; File.new("/Volumes/HP/pot/#{base}.jpg"); end
def t_file base; File.new("/Volumes/HP/pot/#{base}.pot"); end
def create_template (filename); if filename =~ /.jpg$/; base = basename(filename); Template.create :title=>base,:preview=>p_file(base),:filename=>t_file(base); end;end
def cp filename; puts filename if create_template(filename); end
Dir.new('/Volumes/HP/pot').each {|filename| cp filename}
